package com.cloudminds.resttest;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@ComponentScan("com.cloudminds.resttest")
@Configuration
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class })
public class ResttestApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(ResttestApplication.class, args);
    }

    @Bean
    public RestTemplate rest(RestTemplateBuilder builder)
    {
        return builder.build();
    }
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(ResttestApplication.class);
    }
}
